package com.ogawa.project6602.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.ogawa.project6602.R
import com.ogawa.project6602.activity.MUSIC_STATUS_PLAY_ING
import com.ogawa.project6602.activity.MUSIC_STATUS_WAIT_DOWN
import com.ogawa.project6602.bean.MusicResponse

class MusicNaoboAdapter :
    BaseQuickAdapter<MusicResponse, BaseViewHolder>(R.layout.item_music_naobo) {
    override fun convert(helper: BaseViewHolder, item: MusicResponse?) {
        helper.setText(R.id.musicTitleTv, item?.name)
        if (item?.isLast==true){
            helper.setTextColor(R.id.musicTitleTv, Color.parseColor("#3FC5FD"))
        }else{
            helper.setTextColor(R.id.musicTitleTv, Color.parseColor("#77181818"))
        }
        when (item?.status) {
            MUSIC_STATUS_WAIT_DOWN -> {
                helper.setImageResource( R.id.musicStatusIv,R.drawable.img_wait_down)
            }
            MUSIC_STATUS_PLAY_ING -> {
                helper.setImageResource( R.id.musicStatusIv,R.drawable.img_item_suspend)
            }
            else -> {
                helper.setImageResource( R.id.musicStatusIv,R.drawable.img_item_start)
            }
        }
    }
}